﻿
Vue.use(VeeValidate)
VeeValidate.Validator.localize('zh_CN');
/**
 扩展验证
 */
VeeValidate.Validator.extend('phonenumber', {
    getMessage: field => field + '必须是11位手机号码',
    validate: value => {
        return value.length == 11 && /^((1[2-9])[0-9]{1}\d{8})$/.test(value)
    }
});
VeeValidate.Validator.extend('password', {
    getMessage: field => field + '最少6位，包括至少1字母、特殊字符、数字',
    validate: value => {
        return /^.*(?=.{6,})(?=.*\d)(?=.*[A-Za-z])(?=.*[!@#$%^&*? ]).*$/.test(value)
    }
});
